package org.example.coupon.controller.front;

import org.example.core.utils.R;
import org.example.coupon.service.CouponPreferentialService;
import org.example.coupon.to.PreferentialTo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author 小杰_cc
 * @version 1.0
 */
@RestController
@RequestMapping("/sms/front/preferential")
public class CouponPreferentialFrontController {

    @Autowired
    private CouponPreferentialService couponPreferentialService;

    @GetMapping("/list")
    public R<Map<Long, PreferentialTo>> getPreferential(@RequestParam("skuIds") List<Long> skuIds){
        Map<Long, PreferentialTo> preferential = couponPreferentialService.getPreferential(skuIds);
        return R.ok(preferential);
    }
}
